﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using time;
using Webdiyer.WebControls.Mvc;
using time;
using myframework._99_热身.time._2011_10_24_scm;

namespace MvcApplication1.Controllers
{
    public class OrderFormController : Controller
    {
        //
        // GET: /OrderForm/

        public ActionResult Index(int? id)
        {
            //DataClasses1DataContext dc = new DataClasses1DataContext();
            //var lc = dc.City.AsEnumerable().Distinct(new JuryComparer()).AsQueryable().Select(m => m).ToPagedList(id ?? 1, 20);
            //return View(lc);
            
            
            DataClasses1DataContext dc = new DataClasses1DataContext();
            var lc = dc.OrderForm.Select(s => s).ToPagedList(id ?? 1, 20);



            return View(lc);
        }

        //
        // GET: /OrderForm/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /OrderForm/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /OrderForm/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /OrderForm/Edit/5
 
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /OrderForm/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /OrderForm/Delete/5
 
        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /OrderForm/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
